package edu.bu.grocerylist.service;

import java.util.List;

import edu.bu.grocerylist.model.GroceryList;
import edu.bu.grocerylist.model.GroceryUser;

public interface IGroceryListService {

	/**
	 * Creates a new GroceryList object so that other classes do not have to
	 * worry about instantiation
	 * 
	 * @return
	 */
	public abstract GroceryList createGroceryList();

	/**
	 * Copies the base information and templates a new GroceryList
	 * @param groceryList The groceryList we're copying
	 * @return The new templated grocery list
	 */
	public abstract GroceryList templateGroceryList(GroceryList groceryList);
	
	/**
	 * Gets the GroceryList object of a particular user
	 * @param user The user whose grocery lists we want
	 * @return The list of grocery lists of the user
	 */
	public List<GroceryList> getUsersGroceryList(GroceryUser user);

	/**
	 * Obtains a groceryList object based on the database id of the list
	 * @param groceryListId The list identifier
	 * @return The found grocery list object
	 */
	public GroceryList getGroceryListById(int groceryListId);
	
	/**
	 * Saves the grocery list to the data store
	 * @param list The list to save (can be new or existing)
	 * @return the saved grocery list object
	 */
	public GroceryList saveGroceryList(GroceryList list);
	
	/**
	 * Removes the GroceryList from the datastore
	 * @param list The list to delete
	 * @return true if successful, false otherwise
	 */
	public boolean deleteGroceryList(GroceryList list);

}